<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>闭包补充例子2-JS进阶（二）</title>
    </head>

    <body>
        <pre>
            <code>
                    // 闭包补充例子2

                    function foo() {
                        var a = 10;

                        function fn1() {
                            return a;
                        }

                        function fn2() {
                            return 10;
                        }

                        fn2();
                    }

                    foo();

            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/closure_2.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>

</html>